<?php
/*
 * Created on 2008-11-7
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
 class CompanyGroup extends AppModel{
 	var $name="CompanyGroup";
 	var $useTable="company_group_mst";
 	var $primaryKey = 'id';
 	
 	var $hasAndBelongsToMany = array('Company' =>
                               array('className'    => 'Company',
                                     'joinTable'    => 'companys_companygroups',
                                     'foreignKey'   => 'company_group_id',
                                     'associationForeignKey'=> 'company_id',
                                     'conditions'   => '',
                                     'order'        => '',
                                     'limit'        => '',
                                     'uniq'         => true,
                                     'finderQuery'  => '',
                                     'deleteQuery'  => '',
                               )
                               );
 
 	
 	function doupdate($data)
	{
		$id=$data['CompanyGroup']['id'];
		$name=$data['CompanyGroup']['name'];
		$cg_name=$data['CompanyGroup']['cg_name'];
		$sql="update company_group_mst set name = '"
		.$name."',cg_name = '".$cg_name."',modified = now() "
		."where id = ".$id;
		$p=$this->query($sql);
	}
 }
?>
